cmake_minimum_required(VERSION 3.10)

set(PROJECT_N libharu_demo)
project(${PROJECT_N} VERSION 1.0)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_CXX_STANDARD_REQUIRED True)

# 获取所有包含目录的宏
macro(header_directories return_list includes_base_folder)
    file(GLOB_RECURSE new_list ${includes_base_folder}/*.h ${includes_base_folder}/*.hpp)
    set(${return_list} ${new_list})
endmacro()

# 使用上述宏
header_directories(INCLUDES ${PROJECT_SOURCE_DIR}/include)

message("包含的文件:")
foreach(file ${INCLUDES})
    message(STATUS ${file})
endforeach()

file(GLOB_RECURSE SRCS ${PROJECT_SOURCE_DIR}/src/*.cpp ${PROJECT_SOURCE_DIR}/src/*.c)

message("源文件:")
foreach(file ${SRCS})
    message(STATUS ${file})
endforeach()

add_executable(${PROJECT_N} ${SRCS})

target_include_directories(${PROJECT_N} PUBLIC include)

# 查找FreeType 2库
find_package(Freetype REQUIRED)
include_directories(${FREETYPE_INCLUDE_DIRS})

# 链接到FreeType 2库
target_link_libraries(${PROJECT_N}
    ${FREETYPE_LIBRARIES}
    /mnt/e/libharu_demo/lib/libhpdf.so
    /mnt/e/libharu_demo/lib/libhpdf.so.2.4
    /mnt/e/libharu_demo/lib/libhpdf.so.2.4.4
    -lpodofo
)
